use clap::{Parser, Subcommand};

use super::manual::*;

#[derive(Parser, Debug)]
pub struct Args {
    #[arg(
        short,
        long,
        help = "Input files and operations. See `covar-plunderer manual` for more information."
    )]
    pub input_complex: Vec<String>,
    #[arg(
        short,
        long,
        help = "Output file. If not specified, output will be written to stdout."
    )]
    pub output_file: Option<String>,

    #[arg(
        short,
        long,
        help = "Verbose mode. Prints additional information during execution."
    )]
    pub verbose: bool,

    #[command(subcommand)]
    pub command: Option<Action>,
}

#[derive(Debug, Subcommand)]
pub enum Action {
    #[command(about = "Display the manual for covar-plunderer")]
    Manual {
        #[command(subcommand)]
        manual_list: ManualList,
    },
}

#[derive(Debug, Subcommand)]
pub enum ManualList {
    #[command(about = "Display manual for `--input-complex` parameter")]
    InputComplex,
}

impl ManualList {
    pub fn display_manual(&self) -> &str {
        match self {
            Self::InputComplex => &MANUAL.input_complex.manual,
        }
    }
}
